<?php
/**
 * Created by PhpStorm.
 * User: taoguliuxian
 * Date: 2020/4/16
 * Time: 11:20
 */

$link=mysqli_connect('localhost','root','root','weixiblog');

$title=$_POST['title'];
$content=$_POST['content'];
if ($link){
    $sql="INSERT INTO `post` ( `title`, `content`, `status`, `author_id`) VALUES ( '".$title."', '".$content."', '2', '2')";
    mysqli_query($link,"set names utf8");
    //echo $sql;
    $res=mysqli_query($link,$sql);
    var_dump($res);
}

header("Location:index.php");